package com.weigj.intercepter;

import com.jfinal.aop.Interceptor;
import com.jfinal.core.ActionInvocation;
import com.jfinal.core.Controller;

public class MyIntercepter implements Interceptor {
	
	//拦截器  
	public void intercept(ActionInvocation ai) {
		Controller controller = ai.getController();
		controller.getSession();
//	    User loginUser = controller.getSessionAttr("loginUser");
//	    if (loginUser != null && loginUser.canVisit(ai.getActionKey()))
		System.out.println("before");
	    ai.invoke();
	    System.out.println("after");
	   // else
	   //controller.redirect("/login.html");
	}

}
